package com.ruoyi.common.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

@Getter
public enum FileTypeEnum {

    PRODUCT("product", "产品", "product"),
    BILL("bill", "账单记录", "bill"),
    STORE("storelogo", "商家logo", "storelogo"),
    PRODLOGO("prodlogo", "产品logo", "prodlogo"),
    SPECIALINFO("specialinfo", "机构公司logo", "specialinfologo"),
    ;

    String value;
    String label;
    String pathUrl;

    FileTypeEnum(String value, String label, String pathUrl){
        this.value = value;
        this.label = label;
        this.pathUrl = pathUrl;
    }

    public static String getPathUrl(String value){
        for (FileTypeEnum typeEnum: values()){
            if (StringUtils.equals(typeEnum.getValue(), value)){
                return typeEnum.getPathUrl();
            }
        }
        return null;
    }
}
